<template>
    <div>
        <vue-ueditor-wrap v-model="msg" @beforeInit="beforeInit" :config="myConfig" editor-id="container" @ready="ready">
        </vue-ueditor-wrap>
    </div>
</template>

<script>


export default {
    name: 'PrintUeditor',
    props: {
       value:{
           type: String,
           default: ''
       }
    },
    data() {
        return {
            msg:'',
            myConfig: {
                // UEDITOR_HOME_URL: "/static/UEditor/",//添加出错
                UEDITOR_HOME_URL: "static/UEditor/",
                serverUrl: 'http://xxxx.com/xxx/',
                initialFrameWidth: '100%',
                initialFrameHeight: 600,
            }
        };
    },
    mounted() {
        this.msg = this.value
    },
    methods: {
        ready(editorInstance) {
            this.$emit('ready', editorInstance)
        },
        beforeInit(editorId) {
            this.$emit('beforeInit', editorId)
        }
    },
    watch: {
        msg: {
            handler(newVal) {
                this.$emit('input', newVal)
            },
            immediate: true
        }
    }
}
</script>

<style scoped></style>
